<?php
/** CREATED BY PhpStorm
 * USER:孟凡
 * DATE:2017/3/3 22221111111111
 * TIME:下午 4:05
 * 1111
 */
header("content-type:text/html;charset=utf-8");
$dbms='mysql';     //数据库类型
$host='localhost'; //数据库主机名
$dbName='intergratecheckdb';    //使用的数据库
$user='Niord';      //数据库连接用户名
$pass='hardwork';          //对应的密码
$dsn="$dbms:host=$host;port=20001;dbname=$dbName";
$dbh=new PDO($dsn,$user,$pass);
$dbh->query("SET NAMES 'utf8'");
$stmt=$dbh->query('SELECT * FROM user');
$row=$stmt->fetchAll();
$person=array();
foreach($row as $v){
    array_push($person,$v['name']);
}
exit(json_encode($person));